
#{extends 'main.html' /} #{set title:'Send Request' /}

<h3>post an idea</h3>

<script type="text/javascript" src="@{'/public/javascripts/jquery.validate.js'}"></script>
<script type="text/javascript" src="@{'/public/javascripts/jquery.validate.min.js'}"></script>
<script type="text/javascript" src="@{'/public/javascripts/validation.js'}"></script> 
	


<!-- Skin CSS file -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/skin.css">
<!-- Utility Dependencies -->
<script src="http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script> 
<script src="http://yui.yahooapis.com/2.9.0/build/element/element-min.js"></script> 
<!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
<script src="http://yui.yahooapis.com/2.9.0/build/container/container_core-min.js"></script>
<script src="http://yui.yahooapis.com/2.9.0/build/menu/menu-min.js"></script>
<script src="http://yui.yahooapis.com/2.9.0/build/button/button-min.js"></script>
<!-- Source file for Rich Text Editor-->
<script src="http://yui.yahooapis.com/2.9.0/build/editor/editor-min.js"></script>

<body class="yui-skin-sam">

<script type="text/javascript">
var editor = new YAHOO.widget.SimpleEditor('content', {
	handleSubmit: false
})

editor._defaultToolbar.titlebar = false;
editor.render();

YAHOO.util.Event.on('save', 'click', function() {
    //Put the HTML back into the text area
    editor.saveHTML();
 
    //The var html will now have the contents of the textarea
    var html = editor.get('element').value;
});

YAHOO.util.Event.on('Save as draft', 'click', function() {
    editor.saveHTML();
 	var html = editor.get('element').value;
});

YAHOO.util.Event.on('msgform', 'submit', function(e){
	YAHOO.util.Event.stopEvent(e);
	editor.saveHTML();
});

</script>

<form id="postIdeaForm"action="@{TopicController.postIdea()}">


<p>
	<label for="title">Title: </label>
	<input  type="text" name="title"
		id="title" />
</p>
<p>
	<label for="content">Your idea: </label>
	<textarea class="yui-skin-sam" name="content" id="content" cols="70" rows="30"></textarea>
</p>
<p>
	<input type="hidden" name="topicID" value="${topicID}" />
	<input type="submit" value="post your idea" name="save" id="save" /> 
	<input type="submit" value="Save as draft" name="saveDraft" id="Save as draft"/>
</p>
</form>

</body>

